#include "Plane.h"

Plane::Plane()
{
}

Plane::Plane(std::istringstream& planes_file)
{
	getline(planes_file, _callNumber, ',');
	getline(planes_file, _model, ',');
	getline(planes_file, _type, ',');
	getline(planes_file, _rg, ',');
	getline(planes_file, _hp, ',');
	getline(planes_file, _tw, '\n');

	// TODO - we are not zeroing out or incrementing the other variables.
}


Plane::~Plane()
{
}

std::string Plane::logLine() const
{
	return _logLine;
}

std::string Plane::callNumber() const
{
	return _callNumber;
}

std::string Plane::model() const
{
	return _model;
}

std::string Plane::type() const
{
	return _type;
}

std::string Plane::rg() const
{
	return _rg;
}

std::string Plane::hp() const
{
	return _hp;
}

std::string Plane::tw() const
{
	return _tw;
}  

std::string Plane::firstDate() const
{
	return _firstDate;
}

std::string Plane::lastDate() const
{
	return _lastDate;
}

double Plane::flights() const
{
	return _flights;
}

double Plane::dayHours() const
{
	return _dayHours;
}

double Plane::nightHours() const
{
	return _nightHours;
}

double Plane::ifr() const
{
	return _ifr;
}

double Plane::gad() const
{
	return _gad;
}

double Plane::xc() const
{
	return _xc;
}

double Plane::cfi() const
{
	return _cfi;
}  

double Plane::dual() const
{
	return _dual;
}

double Plane::pic() const
{
	return _pic;
}

double Plane::sic() const
{
	return _sic;
}
  
double Plane::safety() const
{
	return _sft;
}

//void Plane::setPlane(std::string new_logLine, std::string newType, std::string newModel, std::string newCallnum, std::string newRg, std::string newHp, std::string newTw)
//{
//	_logLine = new_logLine;
//	_type = newType;
//	_model = newModel;
//	_callNumber = newCallnum;
//	_rg = newRg;
//	_hp = newHp;
//	_tw = newTw;
//	_flights = 0;
//	_hours = 0;
//	_night = 0;
//	_ifr = 0;
//	_gad = 0;
//	_xc = 0;
//	_cfi = 0;
//	_dual = 0;
//	_pic = 0;
//	_sic = 0;
//	_sft = 0;
//}

//void Plane::addLogEntry(std::string Date, double newHours, double newNight, double newIfr, double newGad, double newXc, double newCfi,
//						 double newDual, double newPic, double newSic, double newSft)
//{
//	if (_flights == 0)
//		_firstDate = Date;
//
//	_lastDate = Date;
//	_flights += 1;
//	_hours += newHours;
//	_night += newNight;
//	_ifr += newIfr;
//	_gad += newGad;
//	_xc += newXc;
//	_cfi += newCfi;
//	_dual += newDual;
//	_pic += newPic;
//	_sic += newSic;
//	_sft += newSft;
//}
